package hnue.fit.BankingAccount;
import java.text.Format;

public class Account {
	private long sotk;
	private   String tentk;
	private   double sotien;
	final int  phi = 2 ;
	final float LAISUAT = (float)0.02;
	public Account(){
		this.sotk = 0;
		this.tentk = null;
		this.sotien = 0;
	}
	public Account(long sotk, String tentk, double sotien){
		this.sotk = sotk;
		this.tentk = tentk;
		this.sotien = sotien;
	}
	public Account(long sotk, String tentk){
		this.sotk = sotk;
		this.tentk = tentk;
		sotien = 100;
	}
	public long getSotk(long sotk){
		return sotk;
	}
	public void setSotk(long sotk){
		this.sotk = sotk;
	}
	public String getTentk(String tentk){
		return tentk;
	}
	public void setTentk(String tentk){
		this.tentk = tentk;
	}
	public double getSotien(double sotien){
		return sotien;
	}
	public void setSotien(double sotien){
		this.sotien = sotien;
	}
	public String toString()
	{
		return "So tai khoan: "+ this.sotk +"\nTen tai khoan: "+this.tentk+ "\n So tien:"+ this.sotien;
	}
	public void Naptien(double Sotiennap)
	{
		if(Sotiennap < 0) 
			System.out.print ("So tien nap vao phai lon hon 0");
		else {
		sotien = sotien + Sotiennap;
		System.out.print("sotien"+ sotien);
		}
		}
	public void Ruttien(double Sotienrut)
	{
		if(Sotienrut > sotien) 
			System.out.print("so tien trong tai khoan khong du de rut vui long nhap lai ");
		else if(Sotienrut < 50 ) 
			System.out.print("so tien rut phai > 50 vui long nhap lai ");
		else sotien = sotien - (Sotienrut + phi);
	}
	public void daohan(){
		sotien = sotien + sotien*LAISUAT;
	}
}
